/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-08-02
 * Time: 23:35
 */
class Solution1 {
    public String modifyString(String s) {
        char[] ch = s.toCharArray();
        int n = s.length();

        for(int i = 0; i < s.length(); i++) {
            if(ch[i] == '?') {
                for(char x = 'a'; x <= 'z'; x++) {
                    if((i == 0 || ch[i-1] != x)&&(i == n-1 || ch[i+1] != x)) {
                        ch[i] = x;
                        break;
                    }
                }
            }
        }
        return String.valueOf(ch);
    }
}
